package day_803;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class JframeDome1 {
	public static void main(String[] args) {
		
		JFrame jFrame = new JFrame("用户登录");
		JPanel jpPanel = new JPanel();
		jFrame.add(jpPanel);

		// 设置布局 三行一列
		jpPanel.setLayout(new GridLayout(3, 1));
		// 创建组件,用户
		JPanel name = new JPanel();
		JLabel namelabel = new JLabel("用户名   ：");
		JTextField nametext = new JTextField(10);
		name.add(namelabel);
		name.add(nametext);
		jpPanel.add(name);
		//
		JPanel password = new JPanel();
		JLabel passwordlabel = new JLabel("登录密码：");
		JTextField passwordtext = new JTextField(10);
		password.add(passwordlabel);
		password.add(passwordtext);
		jpPanel.add(password);
		//
		JPanel anniujpanel = new JPanel();
		JButton denglu=new JButton("登录");
		JButton quxiao=new JButton("取消");
		anniujpanel.add(denglu);
		anniujpanel.add(quxiao);
		jpPanel.add(anniujpanel);

		
		// 设定大小，显示
		jFrame.setSize(300, 150);
		jFrame.setVisible(true);
		jFrame.setLocation(700,300);
		jFrame.setDefaultCloseOperation(jFrame.EXIT_ON_CLOSE);
	}
}
